package com.qiyue.common.vo;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by y747718944 on 2018/2/8
 * 树结构 base model
 */
public class TreeNode {

    /**
     * 节点id
     */
    protected Long id;
    /**
     * 节点父级
     */
    protected Long parentId;
    /**
     * 节点child
     */
    List<TreeNode> children = new ArrayList<TreeNode>();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public List<TreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<TreeNode> children) {
        this.children = children;
    }

    public void add(TreeNode node){
        children.add(node);
    }
}
